#include <tchar.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

#include "GoogleService.hpp"
#include "XmlUtils.hpp"
#include "GoogleData.hpp"

const char* GoogleData::GetData(TiXmlElement* pElement, const char* pType, const char* pName)
{
	if(!pElement) return NULL;

	pElement = pElement->FirstChildElement(pType);
	while(pElement) {
		const char* pValue = XmlUtils::GetAttribute(pElement, "name");
		if(pValue && strcmp(pValue, pName)==0) {
			return pElement->GetText();
		}
		pElement = pElement->NextSiblingElement(pType);
	}

	return NULL;
}
